<?php if(Mage::getStoreConfig('blog/menu/show_recent_post')):?>
<?php 
	$helperBlog = Mage::helper('blog');
	$thumnailWidth = Mage::getStoreConfig('blog/info/recent_thumbnail_width');
	$thumnailHeight = Mage::getStoreConfig('blog/info/recent_thumbnail_height');
?>
<div class="block em_block-recent-post em-line-01">
    <div class="block-title">
        <strong><span><?php echo $this->__('Recent Posts'); ?></span></strong>
    </div>
    <div class="block-content">        
        <ul class="em-recent-post">
            <?php foreach ($this->getRecentPost() as $p): ?>
                <li class="item">
					<?php if($p->getImage() && Mage::getStoreConfig('blog/info/show_thumbnail_recent_post')):?>
					<a href="<?php echo $p->getPostUrl();?>">
						<img src="<?php echo $helperBlog->resizeImage($p->getImage(),$thumnailWidth,$thumnailHeight,"emblog/post",'thumbnail');?>"/>
					</a>
					<?php endif;?>
                    <a class="post-title em-blog-title" href="<?php echo $p->getPostUrl(false);?>" ><?php echo $p->getTitle();?></a>
                    
                    <p class="intro">
                        <?php echo $p->getPostIntro(); ?>
                    </p>
                    <div class="post-header">
                        <p class="post-by">
                            <span class="post-user"><span><?php echo $p->getAuthor()->getUsername(); ?></span></span>
                        </p>
                        <?php $date = new DateTime($p->getCreatedAt());?>
                        <span class="post-time"><small class="time-stamp"><?php echo $date->format('M j Y'); ?></small></span>
                    </div>
                </li>
            <?php endforeach; ?>
        </ul>
    </div>
</div>
<?php endif;?>